<?php
header('Content-type:text/html;charset=utf-8');

//包含数据库配置文件
include '../../public/dbconfig.php';
//包含函数库文件
include '../../public/func.inc.php';
//链接数据库
$link = conn();
//var_dump($link);
//var_dump($_POST);

$title = $_POST['title'];
$pic = $_FILES['pic']['name'];
//var_dump($pic);
//exit;
$url = $_POST['url'];
$descript = $_POST['descript'];
$rtime = time();



$sql = "insert into bbs_fri(title,pic,url,descript,rtime) values('{$title}','{$pic}','{$url}','{$descript}','{$rtime}')";
//var_dump($sql);

$res = mysqli_query($link,$sql);
//var_dump($res);
//exit;
if($res){
	echo '<script>alert("添加成功");window.location.href="list.php";</script>';
}else{
	echo '<script>alert("添加失败");window.location.href="add.html";</script>';
	
}
mysqli_close($link);




























